home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / TCL1 / JOHNLOVE / C_SOURCE / CMETER.H < prev    next >
Text File  |  1992-02-16  |  2KB  |  75 lines

  1. /********************************************************************
  2.  "CMeter.h"
  3.  
  4.  by:                            Walt Davis [MacTutor, September 1991]
  5.  
  6.  converted to "C" & OOP by:        John A. Love, III
  7.                                  using Symantec's "THINK C", v 5.0.1
  8.  ********************************************************************/
  9.  
  10.  
  11.  
  12.  
  13. #define _H_CMeter
  14.  
  15. #include <Global.h>
  16. #include <CApplication.h>
  17. #include <CDocument.h>
  18. #include <CPane.h>
  19. #include <CPaneBorder.h>
  20.  
  21.  
  22. struct CMeterMainPane : CPane    {                /* Pane #1 */
  23. /* Includes string "title" above progress bar + "% Completed" scale below it: */
  24.  
  25.         Str255        mTitle;
  26.     
  27.     void    Draw (Rect *area);
  28. };
  29.  
  30.  
  31. struct CProgressBar : CMeterMainPane    {        /* Pane #2 */
  32. /* Draws the graduation marks within the progress bar: */
  33.  
  34.     void    Draw (Rect *area);
  35. };
  36.  
  37.  
  38. struct CProgressBorder : CPaneBorder    {
  39. /* Round frame for the above progress bar: */
  40.  
  41.     void    IPaneBorder (short borderFlags);
  42.     void    DrawBorder (Rect *paneFrame);
  43. };
  44.  
  45.  
  46. struct CMakingProgress : CProgressBar    {        /* Pane #3 */
  47.  
  48.         Boolean        start;
  49.         short        maxSteps, currStep;
  50.  
  51.     void    Draw (Rect *area);
  52.     short    Calculate (void);            /* Returns new "currStep" */
  53. };
  54.  
  55.  
  56. struct CMeter : CDocument    {                    /* The Supervisor of all three */
  57.         
  58.         LongFunc            calc;        /* Calculates completion % */
  59.         // Two sub-views below the main pane:
  60.         CProgressBar        *meterProgressBar;
  61.         CMakingProgress        *progressO;
  62.         
  63.     void    IMeter (short WINDid, LongFunc calculateProgress, Str255 bannerStr,
  64.                     short maxSteps, CApplication *itsSupervisor);
  65.     void    StartProgress (void);
  66.     void    UpdateProgress (void);
  67.     void    EndProgress (void);
  68.     void    Dispose (void);
  69. };
  70.  
  71.  
  72.  
  73.  
  74. /*    { end file "CMeter.h" }  */
  75.